package com.mjk.common.base.constns;

import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * 状态
 * @author jafek
 *
 */
@Getter
public enum BeeStatus {

	RUNNING("1","运行"),STOP("0","停止")
	;
	private final String code;
	private final String remark;
	BeeStatus(String code, String remark){
		this.code = code;
		this.remark = remark;
	}


    public static String getMsg(String index) {
		for (BeeStatus c : values()) {
			if (c.getCode().equals(index)) {
				return c.remark;
			}
		}
		return null;
	}

	public static Map<String, String> toMap() {
		BeeStatus[] ary = values();
		Map<String, String> enumMap = new HashMap<>();
        for (BeeStatus beeStatus : ary) {
            enumMap.put(String.valueOf(beeStatus.getCode()),
                    beeStatus.getRemark());
        }
		return enumMap;
	}
	


}
